package com.zhuhjay.chat.client.manager;

import io.netty.util.concurrent.Promise;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author ZhuHJay
 * @date 2023/3/11 0:23
 */
public class RpcServicePromiseManager {

    private static final Map<Integer, Promise<Object>> PROMISES = new ConcurrentHashMap<>();

    public static void push(int sequenceId, Promise<Object> promise) {
        PROMISES.put(sequenceId, promise);
    }

    public static Promise<Object> remove(int sequenceId) {
        return PROMISES.remove(sequenceId);
    }

}
